package com.syezon.wifikey.setting;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.syezon.wifikey.R;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class VideoGiftCloseAdTipDialog extends Dialog {

    public static void showTip(Context context) {
        VideoGiftCloseAdTipDialog enterPwdDialog = new VideoGiftCloseAdTipDialog(context);
        enterPwdDialog.show();
    }

    public VideoGiftCloseAdTipDialog(@NonNull Context context) {
        this(context, 0);
    }

    public VideoGiftCloseAdTipDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
        requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉title，在有的手机dialog顶部会出现空白
        setContentView(View.inflate(context, R.layout.app_setting_video_gift_close_ad_tip_dialog, null));
        ButterKnife.bind(this);
        // 设置弹出窗体的宽和高
        setCanceledOnTouchOutside(true);
        setCancelable(true);
        Window window = getWindow();
        window.setLayout(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }


    @OnClick({R.id.tv_close})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_close:
                dismiss();
                break;
        }
    }
}
